







Namespace: Wintellect.PowerCollections
Assembly:
PowerCollections (in PowerCollections.dll)
Syntax
C# |
---|
[SerializableAttribute] public class OrderedBag<T> : CollectionBase<T>, ICloneable |
Visual Basic (Declaration) |
---|
<SerializableAttribute> _ Public Class OrderedBag(Of T) _ Inherits CollectionBase(Of T) _ Implements ICloneable |
Visual C++ |
---|
[SerializableAttribute] generic<typename T> public ref class OrderedBag : public CollectionBase<T>, ICloneable |
Type Parameters
- T
Remarks
The items are compared in one of three ways. If T implements IComparable<TKey> or IComparable, then the CompareTo method of that interface will be used to compare items. Alternatively, a comparison function can be passed in either as a delegate, or as an instance of IComparer<TKey>.
OrderedBag is implemented as a balanced binary tree. Inserting, deleting, and looking up an an element all are done in log(N) + M time, where N is the number of keys in the tree, and M is the current number of copies of the element being handled.
Bag<(Of <T>)> is similar, but uses hashing instead of comparison, and does not maintain the keys in sorted order.
Inheritance Hierarchy
Wintellect.PowerCollections..::CollectionBase<(Of <T>)>
Wintellect.PowerCollections..::OrderedBag<(Of <T>)>